<template>
  <div class="home">
    <h2>首页</h2><br />
    <h3>{{$store.state.counter}}</h3><br/>
    <button @click="add">+</button>&nbsp;
    <button @click="reduce">-</button>
  </div>
</template>

<script>
export default {
  name: 'Home',
  methods: {
    add(){
      this.$store.commit('incream')
    },
    reduce(){
      this.$store.commit('decream')
    }
  }
}
</script>
